home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / Demos / Herois / Codigo.Cst / 00029_Script_Beeps aleatorios < prev    next >
Text File  |  1999-03-19  |  1KB  |  40 lines

  1. property memSom
  2. property ligado
  3. property minTocando, maxTocando
  4. property crono
  5.  
  6. on getBehaviorDescription
  7.   return "Faz busca automatica de palavra clicada"
  8. end
  9.  
  10. on getPropertyDescriptionList
  11.   set p_list = [ ¼
  12.     #memSom: [ #comment:   "Lista de membros com som",¼
  13.                  #format:   #list, ¼
  14.                  #default:    ["MembroSom1","MembroSom2"] ],¼
  15.     #minTocando: [ #comment:   "Tempo minimo de espera entre cada beep",¼
  16.                  #format:   #integer, ¼
  17.                  #default:     300],¼
  18.     #maxTocando: [ #comment:   "Tempo maximo de espera",¼
  19.                  #format:   #integer, ¼
  20.                  #default:  800 ]¼
  21.   ]
  22.   return p_list
  23. end
  24.  
  25. on beginSprite me
  26.   set crono = 0
  27. end
  28.  
  29. on idleSprite me
  30.   global gMustUpdate
  31.   if crono = 0 or the timer > crono then
  32.     if crono <> 0 then
  33.       set tmp = random(count(memSom))
  34.       puppetSound 2, getAt(memSom,tmp)
  35.       updateStage
  36.       set gMustUpdate = false
  37.     end if
  38.     set crono = the timer + (random(maxTocando - minTocando)) + minTocando
  39.   end if
  40. end